Skip to content

Add --fail-on-error to the host link command - #453

Merged
kraenhansen merged 1 commit into
callstackincubator:mainfrom
huytdps13400:fix/269-link-fail-on-error
Oct 11, 2026
Merged

kraenhansen merged 1 commit into
callstackincubator:mainfrom
huytdps13400:fix/269-link-fail-on-error

Conversation

@huytdps13400

Copy link
Copy Markdown
Contributor

Fixes #269

Summary

  • add --fail-on-error to the host link command
  • preserve the current default behavior, which warns and skips dependencies that cannot be resolved
  • route the opt-in mode through dependency discovery so Node's original resolution error is printed and the CLI exits unsuccessfully
  • document the option and add a minor changeset

The strict resolver is internal and separate from the existing tolerant wrapper. That keeps the default API/behavior intact and lets the diagnostic logging work in #451 land independently; I will rebase this PR if that resolver change merges first.

Tests

The CLI integration fixture declares broken-package with an exports target pointing to a missing file:

  • default link --android: exit 0 and emit the existing warning
  • link --android --fail-on-error: exit 1 and include broken-package plus missing.js, not an unknown-option error

TDD evidence: the strict-mode test initially failed because the CLI reported unknown option '--fail-on-error'; it passes after the implementation.

Validation

  • pnpm install --frozen-lockfile — Node 24.16.0 / pnpm 10.33.0
  • pnpm run build
  • focused CLI test — 4/4 passed
  • pnpm test — 109/109 passed across host, cmake-rn, and gyp-to-cmake
  • pnpm lint
  • pnpm prettier:check
  • pnpm depcheck
  • runtime react-native-node-api help link — option present
  • git diff --check

@kraenhansen
kraenhansen force-pushed the next branch 2 times, most recently from 535c1c4 to 9c6d9ca Compare October 11, 2026 20:30
@kraenhansen
kraenhansen changed the base branch from next to main October 11, 2026 21:05
@kraenhansen
kraenhansen force-pushed the fix/269-link-fail-on-error branch from 4224605 to b2a29e3 Compare October 11, 2026 21:05
@kraenhansen

Copy link
Copy Markdown
Collaborator

Rebased onto main and retargeted it there, since this doesn't depend on the Hermes changes on next — I dropped the docs/CLI.md hunk, as the link docs only exist on next for now.

@kraenhansen kraenhansen self-assigned this Oct 11, 2026
@kraenhansen
kraenhansen force-pushed the fix/269-link-fail-on-error branch from b2a29e3 to d7fef6c Compare October 11, 2026 21:42
@kraenhansen

Copy link
Copy Markdown
Collaborator

Rebased onto main after #451 landed — the conflict in resolvePackageRoot is resolved by keeping both: it now calls resolvePackageRootOrThrow and logs the original error as #451 does.

@kraenhansen
kraenhansen merged commit 44617d2 into callstackincubator:main Oct 11, 2026
9 checks passed
kraenhansen added a commit that referenced this pull request Oct 12, 2026
Left out when #453 landed on main, where the link docs didn't exist yet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
kraenhansen added a commit that referenced this pull request Oct 12, 2026
Left out when #453 landed on main, where the link docs didn't exist yet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --fail-on-error option to host link command

2 participants